﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using TXTD.Admin.Framework.CostomAttribute;

namespace TXTD.Admin.Data.Entitys.System
{
    /// <summary>
    /// 系统菜单
    /// </summary>
    [Table("SYS_MENU")]
    public class SysMenu : BaseEntity
    {
        /// <summary>
        /// 主键
        /// </summary>
        [Key]
        [Column("MENU_ID")]
        public string MenuId { get; set; } = Guid.NewGuid().ToString("N");

        /// <summary>
        /// 菜单name(唯一，自动生成)
        /// </summary>
        [Column("MENU_NAME")]
        public string MenuName { get; set; } = Guid.NewGuid().ToString("N");

        /// <summary>
        /// 父级菜单id
        /// </summary>
        [StringLength(32)]
        [Column("PARENT_MENU_ID")]
        public string? ParentMenuId { get; set; }

        /// <summary>
        /// 菜单标题
        /// </summary>
        [Column("MENU_TITLE")]
        public string MenuTitle { get; set; }

        /// <summary>
        /// 菜单路径
        /// </summary>
        [Column("MENU_PATH")]
        public string MenuPath { get; set; }

        /// <summary>
        /// 菜单类型
        /// </summary>
        [Required]
        [Column("MENU_TYPE")]
        public string MenuType { get; set; }

        /// <summary>
        /// 菜单排序
        /// </summary>
        [Column("MENU_SORT")]
        public int MenuSort { get; set; } = 0;

        /// <summary>
        /// 组件路径
        /// </summary>
        [Column("COMPONENT_PATH")]
        public string ComponentPath { get; set; }

        /// <summary>
        /// 打开方式
        /// </summary>
        [Column("OPEN_WAY")]
        public string OpenWay { get; set; }

        /// <summary>
        /// 是否启用
        /// </summary>
        [Column("ENABLED")]
        public bool Enabled { get; set; } = true;

        /// <summary>
        /// 菜单权限
        /// </summary>
        [Column("MENU_PERMISSIONS")]
        public string MenuPermissions { get; set; } = "";
    }
}
